package com.dead.letter.controller;

import com.dead.letter.config.MQConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class TestController {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    @RequestMapping("/test/{name}")
    public String test(@PathVariable("name")String name){

        rabbitTemplate.convertAndSend(MQConfig.BUSINESS_EXCHANGE_NAME,"",name);


        return "SUCCEESS";
    }
}
